#pragma once

#include <QWidget>
#include <QDir>
#include <DockWidgetInterface.h>
#include "WorkspaceExplorerExport.h"

class QToolBar;
class FileSystemTreeWidget;

namespace Domy {

/**
 * @brief The WorkspaceExplorerWindow class
 * @note  工作空间浏览窗口
 */
class WORKSPACEEXPLORER_EXPORT WorkspaceExplorerWindow : public DockWidgetInterface
{
    Q_OBJECT
public:
    WorkspaceExplorerWindow(ActionEnableCtrl ctrl, QWidget *parent);
    ~WorkspaceExplorerWindow();

    virtual QDockWidget *createDockWidget() override;

signals:
    void signalOpenFile(const QString &file_path);

private slots:
    void slotOnOpenBtnClicked();
    void slotOnCloseBtnClicked();

private:
    void openWorkspace(const QString &dir_path);

private:
    bool m_is_open;

    QToolBar    *m_tool_bar;
    FileSystemTreeWidget *m_tree_widget;

    QAction     *m_act_open;
    QAction     *m_act_close;
};

} // namespace
